﻿using Microsoft.AspNetCore.Hosting;
using System;
using System.IO;


namespace Dora.ApiGateway
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.0
            Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Production");
            //// https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-2.0
            //Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "Surging.Apm.Skywalking");
            Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "SkyAPM.Agent.AspNetCore");
            var host = new WebHostBuilder()
                .UseUrls("http://*:729")
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup<Startup>()
                .UseApplicationInsights()
                .Build();
            host.Run();

        }
    }
}
